Commands And Events

To specify the processing order of specific tasks in Apis modules, you can use "Events and Commands". An "Event" is an outgoing notification from an Apis module. For example, a notification could be sent when a calculation has finished. A "Command" is an incoming notification to an Apis module, telling the module to perform a specific task. For example, this could be to calculate new values based on the present data values.

The Apis Event Broker controls the relationship between events and commands. An "Event" can be configured to trigger a series of "Commands". The commands will then be executed in the order specified when an event notification is sent from an Apis module to the event broker.

The events and commands are specific to each type of Apis module. For the modules handling external items, the event "ExternalItems", and the command "HandleExternalItems", are common. The "ExternalItems" event is a timer event handling exchange of external items. The period of the timer is specified in the "ExchangeRate" attribute of the module. The timer is only running if the module has configured external items. The "HandleExternalItems" command handles the updating of the items connected to external items.